import request from 'UTIL/request'

/**
 * 回款列表
 * @param params
 */
export function GetList(params) {
  return request({
    url: 'crmReceivables/queryPageList',
    method: 'POST',
    data: params
  })
}

/**
 * 回款详情
 * @param params
 */
export function QueryById(params) {
  return request({
    url: `crmReceivables/queryById/${params.receivablesId}`,
    method: 'POST',
    data: params
  })
}

/**
 * 基本信息
 */
export function InformationById(params) {
  return request({
    url: `crmReceivables/information/${params.id}`,
    method: 'POST',
    data: params
  })
}

/**
 * 新增/编辑时查询字段
 */
export function QueryFieldList(params) {
  const query = params && params.id ? `/${params.id}` : ''
  return request({
    url: `crmReceivables/field${query}`,
    method: 'POST',
    data: params,
		requestType: 'form'
  })
}

/**
 * 回款创建
 */
export function AddReceivables(params) {
  return request({
    url: 'crmReceivables/add',
    method: 'POST',
    data: params
  })
}

/**
 * 回款编辑
 */
export function UpdateReceivables(params) {
  return request({
    url: 'crmReceivables/update',
    method: 'POST',
    data: params
  })
}

/**
 * 回款删除
 * @param params
 */
export function DeleteByIds(params) {
  return request({
    url: 'crmReceivables/deleteByIds',
    method: 'POST',
    data: params
  })
}
